<?php
if ($session->read('Auth.User.read_only') == true) {
    return;
}
if (!isset($text)) $text = 'Edit';
if (!isset($controller)) $controller = null;
if (!isset($action)) $action = 'view';
if (!isset($icon)) $icon = 'edit';
echo $html->link($text, array('controller' => $controller, 'action' => $action, $params), array( 'class' => "button {$icon}"));
?>